Conditions | 2 |
Total Lines | 20 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
30 | |||
31 | @Post(':id/photos') |
||
32 | @Roles('photographer') |
||
33 | @ApiOperation({ |
||
34 | summary: |
||
35 | 'Create ingestion for a school, and return enpoint to upload files containing photos' |
||
36 | }) |
||
37 | public async index(@Param() idDto: IdDTO): Promise<SchoolUploadEndpointView> { |
||
38 | try { |
||
39 | const ingestionId = await this.commandBus.execute( |
||
40 | new CreateIngestionCommand(idDto.id) |
||
41 | ); |
||
42 | |||
43 | const url = await this.fileUploadAdapter.getEndPoint( |
||
44 | `upload/photo/${ingestionId}.zip` |
||
45 | ); |
||
46 | |||
47 | return new SchoolUploadEndpointView(url); |
||
48 | } catch (e) { |
||
49 | throw new BadRequestException(e.message); |
||
50 | } |
||
53 |